<?php
/* @var $this ProgramController */
/* @var $model Program */
/* @var $form CActiveForm */
?>
<script src="<?php echo Yii::app()->baseUrl . '/ckeditor/ckeditor.js'; ?>"></script>
<link rel="stylesheet" href="http://salesmartlink.com/js/ui/themes/base/jquery.ui.all.css">
<script src="http://salesmartlink.com/js/jquery-1.9.1.js'"></script>
<script src="http://salesmartlink.com/js/ui/jquery.ui.core.js"></script>
<script src="http://salesmartlink.com/js/ui/jquery.ui.widget.js"></script>
<script src="http://salesmartlink.com/js/ui/jquery.ui.datepicker.js"></script>
<script>
    $(function() {
        $("#datepicker1").datepicker({
            changeMonth: true,
            changeYear: true,
        });
        $("#datepicker2").datepicker({
            changeMonth: true,
            changeYear: true,
        });
        $("#datepicker1").datepicker("option", "dateFormat", 'yy-mm-dd');
        $("#datepicker2").datepicker("option", "dateFormat", 'yy-mm-dd');
    });
</script>

<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'program-_program-form',
        // Please note: When you enable ajax validation, make sure the corresponding
        // controller action is handling ajax validation correctly.
        // See class documentation of CActiveForm for details on this,
        // you need to use the performAjaxValidation()-method described there.
        'enableAjaxValidation' => false,
    ));
    ?>



    <?php echo $form->errorSummary($model); ?>

    <div class="form_left">
        <?php echo $form->labelEx($model, 'title'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'title', array('size' => 40, 'maxlength' => 200, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'title'); ?>
    </div>
    <div class="clear"></div>


    <div class="form_left">
        <?php echo $form->labelEx($model, 'stardate'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'stardate', array('id' => 'datepicker1', 'maxlength' => 50, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'stardate'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'enddate'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'enddate', array('id' => 'datepicker2', 'maxlength' => 50, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'enddate'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'flag'); ?>
    </div>
    <div class="form_right">

        <?php echo $form->dropDownList($model, 'flag', array('0' => 'đang ẩn', '1' => 'hiễn thị', '2' => 'hủy bỏ')); ?>
        <?php echo $form->error($model, 'flag'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'show'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'show'); ?>
        <?php echo $form->error($model, 'show'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'endnumber'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'endnumber'); ?>
        <?php echo $form->error($model, 'endnumber'); ?>
    </div>
    <div class="clear"></div>
    <div class="row">
        <?php echo $form->labelEx($model, 'content'); ?>
        <?php echo $form->textArea($model, 'content', array('id' => 'editor1')); ?>
        <?php echo $form->error($model, 'content'); ?>
    </div>
    <br/>
    <div class="form_left">.
    </div>
    <div class="form_right">

        <?php echo CHtml::submitButton('Submit'); ?>
    </div>

    <?php $this->endWidget(); ?>
    <script type="text/javascript">
        CKEDITOR.replace('editor1', {
            filebrowserBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=files',
            filebrowserImageBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=images',
            filebrowserFlashBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=flash',
            filebrowserUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=files',
            filebrowserImageUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=images',
            filebrowserFlashUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=flash'
        });
    </script>
</div><!-- form -->